﻿<UserControl x:Class="Shoozla.View.ID3TagControl"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Background="#DFDFDF"
        >
    <DockPanel LastChildFill="True" Background="{StaticResource BackgroundBrush}" MinHeight="115">
        <Grid  Margin="0,5,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="*"/>

            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120"/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="Artist" HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="0" Grid.Column="0" FontSize="12" ></TextBlock>
            <TextBlock Text="Title"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Album" HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="2" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Genre"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="3" Grid.Column="0" FontSize="12"></TextBlock>          
            <TextBox Text="{Binding Song.Artist, Mode=TwoWay}" Grid.Column="1" MinWidth="362"  FontSize="12" HorizontalAlignment="Stretch"  VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Song.Title, Mode=TwoWay}" Grid.Row="1"  Grid.Column="1" MinWidth="362" HorizontalAlignment="Stretch"  FontSize="12"   VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Song.AlbumName, Mode=TwoWay}" Grid.Row="2"  Grid.Column="1" MinWidth="362" HorizontalAlignment="Stretch"   FontSize="12"   VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Song.Genre, Mode=TwoWay}" Grid.Row="3"  Grid.Column="1" MinWidth="230"   FontSize="12" HorizontalAlignment="Left"   VerticalAlignment="Center" Foreground="Black"></TextBox>
            <WrapPanel  Grid.Row="3" Grid.Column="1" HorizontalAlignment="Stretch" >
                <TextBlock Text="Year"  HorizontalAlignment="left"  Margin="240,0,0,0" VerticalAlignment="Center" FontSize="12"></TextBlock>
                <TextBox Text="{Binding Song.Year, Mode=TwoWay}" MinWidth="89"  HorizontalAlignment="Stretch"  FontSize="12" Margin="10,0,0,0" VerticalAlignment="Center" ></TextBox>
            </WrapPanel>            
            <Grid Grid.RowSpan="5" Grid.Column="2" Margin="0,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120"/>
                </Grid.ColumnDefinitions>
                <Image Source="{Binding Song.ImageBitmap}"  Width="105" Height="105" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center">
                    <Image.BitmapEffect>
                        <DropShadowBitmapEffect Color="black" Direction="320" ShadowDepth="20" Softness="2" Opacity="0.5"/>
                    </Image.BitmapEffect>

                </Image>

            </Grid>
            <WrapPanel Grid.Column="0" Grid.ColumnSpan="2"  Grid.Row="5"   HorizontalAlignment="Left">
                <WrapPanel  Grid.Row="0" VerticalAlignment="Top"  Grid.Column="2">
                    <WrapPanel.Triggers>
                        <EventTrigger RoutedEvent="Button.Click" SourceName="btnPlay">
                            <EventTrigger.Actions>
                                <BeginStoryboard Name="AudioStoryBoard">
                                    <Storyboard x:Name="Storyboard"  SlipBehavior="Slip">
                                        <MediaTimeline Source="{Binding Song.FileName.FullName}" Storyboard.TargetName="audio"></MediaTimeline>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="Button.Click" SourceName="btnStop">
                            <EventTrigger.Actions>
                                <StopStoryboard BeginStoryboardName="AudioStoryBoard" />
                            </EventTrigger.Actions>
                        </EventTrigger>
                    </WrapPanel.Triggers>
                    <MediaElement x:Name="audio"></MediaElement>
                    <Button Grid.Column="2" Width="30" Height="30" Name="btnStop" Style="{StaticResource CmdButtonTransparent}" ToolTip="Stop" >
                        <Image Source="/Shoozla;component/Images/stop.png"  Stretch="UniformToFill"/>
                    </Button>
                    <Button Grid.Column="2" Width="30" Height="30" Name="btnPlay" Style="{StaticResource CmdButtonTransparent}"  ToolTip="Play" >
                        <Image Source="/Shoozla;component/Images/play.png" Stretch="UniformToFill"/>
                    </Button>
                </WrapPanel>
          
                <Button  Width="100" Height="25" Content="Search Cover" Command="{Binding Path=CmdSearchSingleCover}"  Style="{DynamicResource CmdButton}"  ToolTip="Search a cover for this song" Name="searchSingleCoverBT" />
                <Button  Width="75"  Height="25" Grid.Row="5" Content="Save"  Command="{Binding Path=CmdSaveSong}"  Style="{DynamicResource CmdButton}"  ToolTip="save to file" Name="saveSongBT" />
            </WrapPanel>
        </Grid>
    </DockPanel>
</UserControl>
